<?php
/**
 * Created by PhpStorm.
 * User: 毛文科
 * Date: 2019/5/24
 * Time: 10:49
 */
namespace app\zhongxue\model;
use think\Model;
use think\model\concern\SoftDelete;

class Course extends Model
{
    protected $name = "zhongxue_course";
    protected $pk = "id";
    use SoftDelete;
    protected $deleteTime = "delete_time";
    public function getTeachersAttr($value){
        if($value){
            $value = Teachers::where('status',1)
                ->where('id',$value)
                ->findOrEmpty()
                ->toArray();
        }
        return $value;
    }

}